Skip to main content
Version: Upcoming

SRPairLeggerLegState

V8 Message Definiton

METADATA

AttributeValue
Topic5355-strategy-legger
MLink TokenInternal
ProductSRTrade
accessTypeSELECT

Table Definition

FieldTypeKeyDefault ValueComment
orderNumberBIGINTPRI0PairLegger order number
sideenum - BuySellPRI'None'
spdrSourceenum - SpdrSource'None'
accntVARCHAR(16)''SR trading account
clientFirmVARCHAR(16)''SR client firm
secKey_atenum - AssetType'None'leg Security can be a stock future optExpiry or option must be the same for all legs cp can be call put or both if secType optExpiry
secKey_tsenum - TickerSrc'None'leg Security can be a stock future optExpiry or option must be the same for all legs cp can be call put or both if secType optExpiry
secKey_tkVARCHAR(12)''leg Security can be a stock future optExpiry or option must be the same for all legs cp can be call put or both if secType optExpiry
secKey_yrSMALLINT UNSIGNED0leg Security can be a stock future optExpiry or option must be the same for all legs cp can be call put or both if secType optExpiry
secKey_mnTINYINT UNSIGNED0leg Security can be a stock future optExpiry or option must be the same for all legs cp can be call put or both if secType optExpiry
secKey_dyTINYINT UNSIGNED0leg Security can be a stock future optExpiry or option must be the same for all legs cp can be call put or both if secType optExpiry
secKey_xxDOUBLE0leg Security can be a stock future optExpiry or option must be the same for all legs cp can be call put or both if secType optExpiry
secKey_cpenum - CallPut'Call'leg Security can be a stock future optExpiry or option must be the same for all legs cp can be call put or both if secType optExpiry
secTypeenum - LeggerSecType'None'note stockstock stockfuture futurefuture optExpiryoptExpiry or optionoption are allowed
ratioSMALLINT UNSIGNED0leg ratio note can be in shares contracts vega wvega tvega or wtvega terms optExpiry must be in one of the xVega choices
ratioTypeenum - LegRatioType'None'
legPriorityenum - LegPriority'None'Lead legs fill first note if there are no lead legs the first leg in the list will be treated as the lead leg
legLimitTypeenum - LeggerLimitType'None'leg limit type stock Price future Price optExpiry AtmVol only option Price or StrikeVol
posTypeenum - PositionType'None'note must be Auto for optExpiry not required for stock
ssaleFlagenum - ShortSaleFlag'None'only for stock legs and autohedging
hedgeInstrumentenum - HedgeInst'None'
hedgeSecKey_atenum - AssetType'None'autohedge instrument can be a TickerKey stock or ExpiryKey future required for Stock and Future
hedgeSecKey_tsenum - TickerSrc'None'autohedge instrument can be a TickerKey stock or ExpiryKey future required for Stock and Future
hedgeSecKey_tkVARCHAR(12)''autohedge instrument can be a TickerKey stock or ExpiryKey future required for Stock and Future
hedgeSecKey_yrSMALLINT UNSIGNED0autohedge instrument can be a TickerKey stock or ExpiryKey future required for Stock and Future
hedgeSecKey_mnTINYINT UNSIGNED0autohedge instrument can be a TickerKey stock or ExpiryKey future required for Stock and Future
hedgeSecKey_dyTINYINT UNSIGNED0autohedge instrument can be a TickerKey stock or ExpiryKey future required for Stock and Future
orderSizeINT0working size from parentBrkrStateorderSize sum of all individual orders in cnshare terms
orderActiveSizeINT0order active size from parentBrkrStateorderActiveSize sum of all individual orders in cnshare terms
numActiveBrkrsSMALLINT UNSIGNED0number of parent order legs with legactiveSize legcumFillQty
numAvailLegBrkrsSMALLINT UNSIGNED0number of parent order legs created
cumFillQtyDOUBLE0in LeggerLimitType terms
avgFillPrcDOUBLE0
activeSprdSizeDOUBLE0active size sum of all individual orders in ratio type terms
legStatusTINYTEXT''
targetStateenum - LeggerTargetState'None'
targetSprdSizeFLOAT0
targetLimitPriceFLOAT0
bestBidPrcFLOAT0leg best bid price in terms of limit type
bestAskPrcFLOAT0leg best ask price
bestBidSizeFLOAT0leg best bid size in terms of ratio type
bestAskSizeFLOAT0leg best ask size
numNewOrdersINT0number of parent orders published
numLimitUpdatesINT0number of parent limit messages published
timestampDATETIME(6)'1900-01-01 00:00:00.000000'

PRIMARY KEY DEFINITION (Unique)

FieldSequence
orderNumber1
side2

CREATE TABLE EXAMPLE QUERY

CREATE TABLE `SRTrade`.`MsgSRPairLeggerLegState` (
`orderNumber` BIGINT NOT NULL DEFAULT 0 COMMENT 'PairLegger order number',
`side` ENUM('None','Buy','Sell') NOT NULL DEFAULT 'None',
`spdrSource` ENUM('None','SpdrTicket','SpdrSingle','SRSE','FIX','HedgeTool','TradeHedge','OpenHedge','AutoHedge','Orphan','RiskManager','OrderManager','ManagedOrder','RFQRespSrvr','Legger','SRSEDrop','FixDrop','TicketDrop','SysTest','RFRResponse','AllocOmni','AllocClient','CertGateway','MLegResponse','LeggerX','DropManager','AutoHedgeSrvr','AuctionStrategySrvr','AllocBlockFace','AllocBlockCust','IceChatGateway','EXS2SRC','MLinkResponse','AutoResponderVD','AutoResponderRC','AutoResponderSN','AutoResponderBX','MLink','SymChatGateway') NOT NULL DEFAULT 'None',
`accnt` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'SR trading account',
`clientFirm` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'SR client firm',
`secKey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None' COMMENT 'leg Security (can be a stock, future, optExpiry, or option) [must be the same for all legs] [cp can be call, put, or both if secType = optExpiry]',
`secKey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'leg Security (can be a stock, future, optExpiry, or option) [must be the same for all legs] [cp can be call, put, or both if secType = optExpiry]',
`secKey_tk` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'leg Security (can be a stock, future, optExpiry, or option) [must be the same for all legs] [cp can be call, put, or both if secType = optExpiry]',
`secKey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'leg Security (can be a stock, future, optExpiry, or option) [must be the same for all legs] [cp can be call, put, or both if secType = optExpiry]',
`secKey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'leg Security (can be a stock, future, optExpiry, or option) [must be the same for all legs] [cp can be call, put, or both if secType = optExpiry]',
`secKey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'leg Security (can be a stock, future, optExpiry, or option) [must be the same for all legs] [cp can be call, put, or both if secType = optExpiry]',
`secKey_xx` DOUBLE NOT NULL DEFAULT 0 COMMENT 'leg Security (can be a stock, future, optExpiry, or option) [must be the same for all legs] [cp can be call, put, or both if secType = optExpiry]',
`secKey_cp` ENUM('Call','Put','Pair') NOT NULL DEFAULT 'Call' COMMENT 'leg Security (can be a stock, future, optExpiry, or option) [must be the same for all legs] [cp can be call, put, or both if secType = optExpiry]',
`secType` ENUM('None','Stock','Future','OptExpiry','Option') NOT NULL DEFAULT 'None' COMMENT 'note: stock/stock, stock/future, future/future, optExpiry/optExpiry or option/option are allowed',
`ratio` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'leg ratio (note: can be in shares, contracts, vega, wvega, tvega, or wtvega terms) (optExpiry must be in one of the xVega choices)',
`ratioType` ENUM('None','Qty','Vega','WVega','TVega','WtVega') NOT NULL DEFAULT 'None',
`legPriority` ENUM('None','Lead') NOT NULL DEFAULT 'None' COMMENT 'Lead leg(s) fill first (note: if there are no lead legs the first leg in the list will be treated as the lead leg)',
`legLimitType` ENUM('None','Prc','StrikeVol','AtmVol') NOT NULL DEFAULT 'None' COMMENT 'leg limit type (stock: Price, future: Price, optExpiry: AtmVol only, option: Price or StrikeVol)',
`posType` ENUM('None','Opening','Closing','Auto') NOT NULL DEFAULT 'None' COMMENT 'note: must be Auto for optExpiry (not required for stock)',
`ssaleFlag` ENUM('None','Long','Short','Exempt','Auto','Open','Close','Cover','NA') NOT NULL DEFAULT 'None' COMMENT 'only for stock legs (and autohedging)',
`hedgeInstrument` ENUM('None','Default','FrontMonth','Stock','Future') NOT NULL DEFAULT 'None',
`hedgeSecKey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None' COMMENT 'autohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future]',
`hedgeSecKey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'autohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future]',
`hedgeSecKey_tk` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'autohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future]',
`hedgeSecKey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'autohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future]',
`hedgeSecKey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'autohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future]',
`hedgeSecKey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'autohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future]',
`orderSize` INT NOT NULL DEFAULT 0 COMMENT 'working size (from parentBrkrState.orderSize) (sum of all individual orders; in cn/share terms)',
`orderActiveSize` INT NOT NULL DEFAULT 0 COMMENT 'order active size (from parentBrkrState.orderActiveSize) (sum of all individual orders; in cn/share terms)',
`numActiveBrkrs` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'number of parent order legs with leg.activeSize > leg.cumFillQty',
`numAvailLegBrkrs` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'number of parent order legs created',
`cumFillQty` DOUBLE NOT NULL DEFAULT 0 COMMENT 'in LeggerLimitType terms',
`avgFillPrc` DOUBLE NOT NULL DEFAULT 0,
`activeSprdSize` DOUBLE NOT NULL DEFAULT 0 COMMENT 'active size (sum of all individual orders; in ratio type terms)',
`legStatus` TINYTEXT NOT NULL DEFAULT '',
`targetState` ENUM('None','Take','Post') NOT NULL DEFAULT 'None',
`targetSprdSize` FLOAT NOT NULL DEFAULT 0,
`targetLimitPrice` FLOAT NOT NULL DEFAULT 0,
`bestBidPrc` FLOAT NOT NULL DEFAULT 0 COMMENT 'leg best bid price (in terms of limit type)',
`bestAskPrc` FLOAT NOT NULL DEFAULT 0 COMMENT 'leg best ask price',
`bestBidSize` FLOAT NOT NULL DEFAULT 0 COMMENT 'leg best bid size (in terms of ratio type)',
`bestAskSize` FLOAT NOT NULL DEFAULT 0 COMMENT 'leg best ask size',
`numNewOrders` INT NOT NULL DEFAULT 0 COMMENT 'number of parent orders published',
`numLimitUpdates` INT NOT NULL DEFAULT 0 COMMENT 'number of parent limit messages published',
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000',
PRIMARY KEY USING HASH (`orderNumber`,`side`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='';

SELECT TABLE EXAMPLE QUERY

SELECT
`orderNumber`,
`side`,
`spdrSource`,
`accnt`,
`clientFirm`,
`secKey_at`,
`secKey_ts`,
`secKey_tk`,
`secKey_yr`,
`secKey_mn`,
`secKey_dy`,
`secKey_xx`,
`secKey_cp`,
`secType`,
`ratio`,
`ratioType`,
`legPriority`,
`legLimitType`,
`posType`,
`ssaleFlag`,
`hedgeInstrument`,
`hedgeSecKey_at`,
`hedgeSecKey_ts`,
`hedgeSecKey_tk`,
`hedgeSecKey_yr`,
`hedgeSecKey_mn`,
`hedgeSecKey_dy`,
`orderSize`,
`orderActiveSize`,
`numActiveBrkrs`,
`numAvailLegBrkrs`,
`cumFillQty`,
`avgFillPrc`,
`activeSprdSize`,
`legStatus`,
`targetState`,
`targetSprdSize`,
`targetLimitPrice`,
`bestBidPrc`,
`bestAskPrc`,
`bestBidSize`,
`bestAskSize`,
`numNewOrders`,
`numLimitUpdates`,
`timestamp`
FROM `SRTrade`.`MsgSRPairLeggerLegState`
WHERE
/* Replace with a BIGINT */
`orderNumber` = 1234567890
AND
/* Replace with a ENUM('None','Buy','Sell') */
`side` = 'None';

Doc Columns Query

SELECT * FROM SRTrade.doccolumns WHERE TABLE_NAME='SRPairLeggerLegState' ORDER BY ordinal_position ASC;